package com.quz.jn_travel.controller;


import com.quz.jn_travel.pojo.TravelItem;
import com.quz.jn_travel.pojo.VO.JsonResult;
import com.quz.jn_travel.service.InfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@Api("详细信息相关的api")
@RequestMapping("/info")
public class InfoController {
    @Resource
    InfoService infoService;

    @GetMapping("/getTravelInfo")
    @ApiOperation("拿到详细景点信息")
    @ResponseBody
    public JsonResult getAllBanner(@RequestParam int travel_id) {
        System.out.println(travel_id);
        TravelItem travelInfo= infoService.getTravelItem(travel_id);
        JsonResult jsonResult = new JsonResult(travelInfo);
        return jsonResult;
    }

}
